﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Reflection;
using ZD_DataModel;
using System.Data;
using System.Collections;
using System.Text.RegularExpressions;
using ZD_DataModel;
using System.Reflection;
using ZD_Business;
using System.IO;
using System.Threading;

public partial class _Default : System.Web.UI.Page
{
    object obj = null;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        { 
            ZD_BusinessBase bll = new ZD_BusinessBase();
            t_d_User model = new t_d_User { UserId = new Guid("BB3B1EBE-EF4D-476E-A455-000018E3BD2A") };
            model = bll.GetModel<t_d_User>(model);
            Response.Write(model.UserName);
            //t_d_User model = new t_d_User();
            //foreach (var item in model.GetType().GetProperties())
            //{
            //    Response.Write(item.Name + "：" + item.PropertyType.ToString() + "<hr/>");
            //}
            //Response.Write(Common.ErpPwdDeEncrypt("eJ+gGXu068jNIRECZ8BFag=="));
            //DataTable dt = new DataTable();
            //DataTable dt1 = new DataTable();
            //List<B_Product> list = new List<B_Product> { new B_Product { ID = 2, Title = "Rpeater绑定测试" } };
            ////List<B_Product> list = new List<B_Product>();
            //dt.Columns.Add("Id");
            //dt.Columns.Add("Title");
            //dt1.Columns.Add("Id");
            //dt1.Columns.Add("Title");
            //DataRow dr = dt.NewRow();
            //DataRow dr1 = dt1.NewRow();
            //dr[0] = 1;
            //dr[1] = "测试1";
            //dr1[0] = 2;
            //dr1[1] = "测试222";
            //dt.Rows.Add(dr);
            //obj = list;
            //DataSet ds = new DataSet();
            //ds.Tables.Add(dt);
            //ds.Tables.Add(dt1);
            //obj = list;
            //Bind(obj);
            ////Response.Write(IsDs(obj));
            //foreach (Control item in this.Form.Controls)
            //{
            //    Response.Write(item.ID + "<hr/>");
            //}
        }
    }

    public void Bind(object obj)
    {
        Literal lit = new Literal();
        lit.Text = "<font style=\"color:red;\">暂无数据！</font>";

        //this.Repeater1.DataSource = obj;
        //Repeater1.Controls.Add(lit);
        //this.Repeater1.DataBind();
        Repeater1.Controls.Add(lit);
    }

    public bool IsDs(object data)
    {
        if (data is DataSet)
            return true;
        return false;
    }
}
